#include "manano_common.h"

#include "mdtx-online/indicator/indicator_type_filter.h"
namespace indi = mdtx::online::indicator;

using highpass = unary1<indi::highpass>;
using lowpass = unary1<indi::lowpass>;

void bind_indi_filter(py::module &m)
{
    auto mod = m.def_submodule("filter", "Online filters");
    {
        auto v = py::class_<highpass>(m, "highpass")
                     .def(py::init<double>(), py::arg("a"))
                     .def("run", &highpass::run, py::arg("x"), "Run calc")
                     .def("run", &highpass::run2, py::arg("x"), "Run batch calc");
        v.doc() = R"mydoc(
                    Discrete-time first-order high-pass filter
                    Args:
                        a (float64) : filter factor, equals to RC / (RC + delta_T))mydoc";
    }
    {
        auto v = py::class_<lowpass>(m, "lowpass")
                     .def(py::init<double>(), py::arg("a"))
                     .def("run", &lowpass::run, py::arg("x"), "Run calc")
                     .def("run", &lowpass::run2, py::arg("x"), "Run batch calc");
        v.doc() = R"mydoc(
                    Discrete-time first-order low-pass filter
                    Args:
                        a (float64) : filter factor, equals to delta_T / (RC + delta_T))mydoc";
    }
}
